package util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class UserParser {
	private Pattern regResourceIdPattern;
	private Matcher matcher;
	private String name;
	
	
	public UserParser(String path ) {
		regResourceIdPattern = Pattern.compile("/([a-zA-Z0-9]+)");
		if(path == null || path.equals("/")){
			name = null;
			return;
		}
		matcher = regResourceIdPattern.matcher(path);
		if(matcher.find()){
			//System.out.println(matcher.group(0));
			//id = Integer.parseInt(matcher.group(1));
			name = matcher.group(1);
			return;
		}		
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}
	
}
